package com.muke.service;

import com.muke.dto.Exposer;
import com.muke.dto.SecKillExecution;
import com.muke.entity.SecKill;
import com.muke.exception.RepeatKillException;
import com.muke.exception.SecKillClosedException;
import com.muke.exception.SecKillException;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Date: 2019-10-9.
 * Time: 13:24.
 * Explain: 秒杀库存 service
 *
 * @author hezx
 */
public interface SecKillService {

    /***
    * @Description: 秒杀活动列表
    * @Author: hezx
    * @Date: 2019-10-9
    * @param
    * @return: java.util.List<com.muke.entity.SecKill>
    */
    List<SecKill> findSecKillList();

    /***
    * @Description: 根据 秒杀ID 查询详情
    * @Author: hezx
    * @Date: 2019-10-9
    * @param secKillId
    * @return: com.muke.entity.SecKill
    */
    SecKill getById(Long secKillId);

    /*** 
    * @Description: 秒杀开始 输出秒杀地址，否则输出系统时间 和秒杀时间
    * @Author: hezx
    * @Date: 2019-10-9 
    * @param secKillId 
    * @return: com.muke.dto.Exposer 
    */
    Exposer getSecKillUrl(Long secKillId);
    
    /*** 
    * @Description: 执行秒杀操作
    * @Author: hezx
    * @Date: 2019-10-9 
    * @param secKillId
    * @param userPhone
    * @param md5
    * @return: SecKillExecution 
    */
    SecKillExecution executeSecKill(Long secKillId, Long userPhone, String md5) throws SecKillException, RepeatKillException, SecKillClosedException;
}
